package com.ruoyi.customerSample.service.impl;


import com.ruoyi.customerSample.domain.SampleDetailBill;
import com.ruoyi.customerSample.mapper.SampleDetailBillMapper;
import com.ruoyi.customerSample.service.ISampleDetailBillService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 样品接收明细Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-04-10
 */
@Service
public class SampleDetailBillServiceImpl implements ISampleDetailBillService
{
    @Autowired(required = false)
    private SampleDetailBillMapper sampleDetailBillMapper;

    /**
     * 查询样品接收明细
     * 
     * @param id 样品接收明细ID
     * @return 样品接收明细
     */
    @Override
    public SampleDetailBill selectSampleDetailBillById(String id)
    {
        return sampleDetailBillMapper.selectSampleDetailBillById(id);
    }

    /**
     * 根据样品类别获取最大编号
     * @param length
     * @param sampleName
     * @return
     */
    @Override
    public String selectsampleNumByType(String length, String sampleName) {
        return sampleDetailBillMapper.selectsampleNumByType(length, sampleName);
    }

    /**
     * 查询样品接收明细列表
     * 
     * @param sampleDetailBill 样品接收明细
     * @return 样品接收明细
     */
    @Override
    public List<SampleDetailBill> selectSampleDetailBillList(SampleDetailBill sampleDetailBill)
    {
        return sampleDetailBillMapper.selectSampleDetailBillList(sampleDetailBill);
    }

    /**
     * 新增样品接收明细
     * 
     * @param sampleDetailBill 样品接收明细
     * @return 结果
     */
    @Override
    public int insertSampleDetailBill(SampleDetailBill sampleDetailBill)
    {
        return sampleDetailBillMapper.insertSampleDetailBill(sampleDetailBill);
    }

    /**
     * 批量新增样品明细
     * @param bills
     * @return
     */
    @Override
    public int batchSampleDetailBill(List<SampleDetailBill> bills) {
        return sampleDetailBillMapper.batchSampleDetailBill(bills);
    }

    /**
     * 修改样品接收明细
     * 
     * @param sampleDetailBill 样品接收明细
     * @return 结果
     */
    @Override
    public int updateSampleDetailBill(SampleDetailBill sampleDetailBill)
    {
        return sampleDetailBillMapper.updateSampleDetailBill(sampleDetailBill);
    }

    /**
     * 批量删除样品接收明细
     * 
     * @param ids 需要删除的样品接收明细ID
     * @return 结果
     */
    @Override
    public int deleteSampleDetailBillByIds(String[] ids)
    {
        return sampleDetailBillMapper.deleteSampleDetailBillByIds(ids);
    }

    /**
     * 删除样品接收明细信息
     * 
     * @param id 样品接收明细ID
     * @return 结果
     */
    @Override
    public int deleteSampleDetailBillById(String id)
    {
        return sampleDetailBillMapper.deleteSampleDetailBillById(id);
    }


    /**
     * 根据来样登记id删除明细
     * @param sid
     * @return
     */
    @Override
    public int deleteSampleDetailBillBySid(String sid) {
        return sampleDetailBillMapper.deleteSampleDetailBillBySid(sid);
    }
}
